package com.fattiger.framework.sessionshare.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.fattiger.framework.sessionshare.session.Session;
import com.fattiger.framework.sessionshare.session.SessionManager;
import com.fattiger.framework.sessionshare.session.redis.RedisSessionManager;

public class LoginStatusServlet extends HttpServlet {
	private static final long serialVersionUID = -2901566165055649574L;
	private SessionManager manager = new RedisSessionManager();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        Session session = manager.getSession(req, false);
        req.setAttribute("userName",session.getAttributes("userName"));
        req.getRequestDispatcher("./status.jsp").forward(req,resp);
    }
}
